package com.cwm.test.composite.demo.transparent;

import java.math.BigDecimal;

public class Course extends CourseComponent {

    private String name;
    private BigDecimal price;

    public Course(String name, BigDecimal price) {
        this.name = name;
        this.price = price;
    }


    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public BigDecimal getPrice() {
        return this.price;
    }

    @Override
    public void print(){
        System.out.println(name + ":" + price + "元");
    }
}
